package designMode.singleton;

//�������ģʽ

public class Singleton {
}

// ����ʽ
class EhanShi {
	private static EhanShi e = null;

	private EhanShi() {
	}

	public static EhanShi getInstance() {
		return e;
	}
}

// ����ʽ����Ҫ����
class LanHanShi {
	private static LanHanShi l = null;

	private LanHanShi() {
	}

	public static synchronized LanHanShi getInstance() {
		if (l == null)
			l = new LanHanShi();
		return l;
	}
}
